<style lang="scss" scoped>
.dashboard {
  position: absolute;
  margin: auto;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 1920px;
  height: 1080px;
  // 修改最上面lop图片
  background: url("../assets/img/newlogo.png") top no-repeat;
  background-size: contain;
  // background: url("../assets/img/logo.png") top no-repeat;
  & > div {
    position: absolute;
    // border: solid 1px rgba(255, 255, 255, 0.2);
  }
}

.title {
  top: 50px;
  left: 30px;
  font-size: 40px;
  color: white;
}
.bg-title {
  position: absolute;
  // top: 48px;
  top: 34px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 464px;
  height: 26px;
  font-size: 35px;
  font-family: YouSheBiaoTiHei;
  font-weight: 400;
  color: #fff;
}

.doughnut {
  top: 107px;
  left: 26px;
  width: 450px;
  height: 198px;
  // border: solid 1px rgba(255, 255, 255, 0.2);
}

.point {
  top: 356px;
  left: 26px;
  width: 450px;
  height: 324px;
  // border: solid 1px rgba(255, 255, 255, 0.2);
}

.line {
  left: 26px;
  bottom: 34px;
  width: 450px;
  height: 314px;
}
.title-box {
  left: 501px;
  width: 911px;
  margin-top: 130px;
  height: 58px;
  display: flex;
}
.title-center {
  display: flex;
  position: relative;
  // background-color: #fff;
  flex: 1;
  // margin: 3px 3px;
  // justify-content: space-between;
  font-size: 20px;
  font-family: YouSheBiaoTiHei;
  font-weight: 400;
  text-align: center;
  // color: #48eaff;
  color: #fff;
  // text-align: center;
  margin: 0 4px;
}
.title-center .ly-tz {
  flex: 1;
  text-align: center;
  line-height: -58px;
  // background-color: #fff;
}

.panel-hight {
  a {
    color: #48eaff;
  }
  position: relative;
  border: 6px solid transparent;
  border-width: 14px;
  border-image-source: url("../assets/img/title-hight.png");
  border-image-slice: 16;
}

// .map {
//   left: 550px;
//   top: 152px;
//   width: 850px;
//   height: 715px;
// }
.water {
  left: 32px;
  top: 93px;
  width: 450px;
  height: 175px;
}
.title-water {
  width: 100%;
  height: 100%;
  display: flex;
  // justify-content: center;
  // align-items: center;
  .water-right {
    width: 100%;
    height: 100%;
    flex: 4;
    padding: 30px 10px 0;
    // background-color: #fff;
  }
  .water-left {
    flex: 3;
    // background-color: pink;
    img {
      top: 140px;
      left: 104px;
    }
    .top {
      width: 100%;
      margin-top: 20px;
      text-align: center;
      font-size: 10px;
      p {
        margin: 0;
        color: #fff;
      }
      h2 {
        margin: 8px 0;
        color: #fbfd83;
        font-size: 19.07px;
      }
    }
    .bott {
      display: flex;
      justify-content: space-around;
      font-size: 12px;
      margin-top: 5px;
      p {
        color: #579ef2;
        font-size: 11.44px;
        margin: 1px 0;
      }
      span {
        color: #2affff;
        font-size: 15.26px;
        margin: 0;
      }
      .bott-left {
        text-align: center;
      }
      .bott-right {
        text-align: center;
      }
    }
  }
}
.pm {
  left: 32px;
  top: 288px;
  width: 450px;
  height: 180px;
}
.air {
  left: 32px;
  top: 483px;
  width: 450px;
  height: 175px;
}
.four-one {
  left: 32px;
  top: 678px;
  width: 450px;
  height: 175px;
}
.soil {
  left: 32px;
  top: 872px;
  width: 450px;
  height: 184px;
}
.gailan {
  left: 503px;
  top: 834px;
  width: 914px;
  height: 212px;
  .gailan-big {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-around;

    .gailan-b-one,
    .gailan-b-two,
    .gailan-b-three {
      display: flex;
      justify-content: center;
      align-items: center;
      .one-left {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 72px;
        height: 72px;
        // border: 2px solid #00ffff;
        margin-right: 10px;
        // border-radius: 50%;
        // box-shadow: 1px, 1px, 2px, 2px;
        // background-color: #fff;

        img {
          width: 100%;
          height: 100%;
          top: 50%;
        }
      }
      .one-right {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        // background-color: pink;
        p {
          margin: 0;
          font-size: 20px;
          font-family: Alibaba PuHuiTi;
          font-weight: 400;
          color: #01c4f7;
        }
        span {
          margin: 0;
          font-size: 35px;
          font-family: DINPro;
          font-weight: bold;
          color: #fbfd83;
        }
      }
    }
  }
}
.status {
  left: 1444px;
  top: 93px;
  width: 444px;
  height: 269px;
}
.collect {
  left: 1444px;
  top: 382px;
  width: 444px;
  height: 671px;
}
.collect-big {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  div {
    flex: 1;
    width: 100%;
    height: 100%;
  }
  .collect-top {
    // background-color: #fff;
  }
  .collect-middle {
    // background-color: pink;
  }
  .collect-bott {
    // background-color: yellowgreen;
  }
}
</style>
<template>
  <div class="dashboard">
    <div class="bg-title">星云智慧园</div>
    <!-- 水质传感器 -->
    <div class="water panel1">
      <div class="public">水质传感器</div>
      <div class="title-water">
        <div class="water-left">
          <div class="top">
            <img src="../assets/img/water.png" alt="" />
            <h2>6.71</h2>
            <p>当前PH值</p>
          </div>
          <div class="bott">
            <div class="bott-left">
              <span>6.71</span>
              <p>历史最低值</p>
            </div>
            <div class="bott-right">
              <span>6.71</span>
              <p>历史最高值</p>
            </div>
          </div>
        </div>
        <div class="water-right">
          <water :title="title1"></water>
        </div>
      </div>
      <!-- <realtime></realtime> -->
    </div>
    <!-- PM2.5/10传感器 -->
    <div class="pm panel1">
      <div class="public1">PM2.5/10传感器</div>
      <pm></pm>
      <!-- <div class="title-water">
        <div class="water-left">
          <div class="top">
            <img src="../assets/img/PM2.5.png" alt="" />
            <h2>2.71</h2>
            <p>当前PM值</p>
          </div>
          <div class="bott">
            <div class="bott-left">
              <span>6.71</span>
              <p>历史最低值</p>
            </div>
            <div class="bott-right">
              <span>6.71</span>
              <p>历史最高值</p>
            </div>
          </div>
        </div>
        <div class="water-right">
          <water :title="title2"></water>
        </div>
      </div> -->
      <!-- <subitem></subitem> -->
    </div>
    <!-- 风速传感器 -->
    <div class="air panel1">
      <div class="public">风速传感器</div>
      <div class="title-water">
        <div class="water-left">
          <div class="top">
            <img src="../assets/img/wind.png" alt="" />
            <h2>6.71</h2>
            <p>当前风速值(m/s)</p>
          </div>
          <div class="bott">
            <div class="bott-left">
              <span>6.71</span>
              <p>历史最低值</p>
            </div>
            <div class="bott-right">
              <span>6.71</span>
              <p>历史最高值</p>
            </div>
          </div>
        </div>
        <div class="water-right">
          <water :title="title3"></water>
        </div>
      </div>
      <!-- <save></save> -->
    </div>
    <!-- 四合一传感器 -->
    <div class="four-one panel1">
      <div class="public">四合一传感器</div>
      <fourone></fourone>
      <!-- <div class="title-water">
        <div class="water-left">
          <div class="top">
            <img src="../assets/img/four-one.png" alt="" />
            <h2>6.71</h2>
            <p>当前空气湿度</p>
          </div>
          <div class="bott">
            <div class="bott-left">
              <span>6.71</span>
              <p>历史最低值</p>
            </div>
            <div class="bott-right">
              <span>6.71</span>
              <p>历史最高值</p>
            </div>
          </div>
        </div>
        <div class="water-right">
          <el-carousel height="130px" interval="5000" indicator-position="none">
            <el-carousel-item v-for="(item, index) in 4" :key="index">
              <water :title="titlef1" v-if="index == 0"></water>
              <water :title="titlef2" v-if="index == 1"></water>
              <water :title="titlef3" v-if="index == 2"></water>
              <water :title="titlef4" v-if="index == 3"></water>
            </el-carousel-item>
          </el-carousel>
        </div>
      </div> -->
      <!-- <save></save> -->
    </div>
    <!-- 土壤温湿度传感器 -->
    <div class="soil panel1">
      <div class="public1">土壤温湿度传感器</div>
      <div class="title-water">
        <div class="water-left">
          <div class="top">
            <img src="../assets/img/soil.png" alt="" />
            <h2>6.71</h2>
            <p>当前土壤温度(℃)</p>
          </div>
          <div class="bott">
            <div class="bott-left">
              <span>6.71</span>
              <p>历史最低值</p>
            </div>
            <div class="bott-right">
              <span>6.71</span>
              <p>历史最高值</p>
            </div>
          </div>
        </div>
        <div class="water-right">
          <water :title="title4"></water>
        </div>
      </div>
      <!-- <save></save> -->
    </div>
    <div class="line-y-ca"></div>
    <div class="title-box">
      <div
        class="panel-title title-center"
        :class="activeClass == index ? 'panel-hight' : ''"
        v-for="(item, index) in itemList"
        :key="index"
        @click="getItem(index)"
      >
        <router-link :to="item.link" class="ly-tz">{{ item.name }}</router-link>
      </div>
    </div>
    <div class="map">
      <!-- <Map></Map> -->
    </div>
    <!-- 概览 -->
    <div class="gailan panel1">
      <div class="public">概览</div>
      <div class="gailan-big">
        <div class="gailan-b-one">
          <div class="one-left">
            <img src="../assets/img/gailan-user.png" alt="" />
          </div>
          <div class="one-right">
            <p>传感器总数(个)</p>
            <span>396</span>
          </div>
        </div>
        <div class="gailan-b-two">
          <div class="one-left">
            <img src="../assets/img/gailan-zong.png" alt="" />
          </div>
          <div class="one-right">
            <p>总类(个)</p>
            <span>5</span>
          </div>
        </div>
        <div class="gailan-b-three">
          <div class="one-left">
            <img src="../assets/img/gailan-lei.png" alt="" />
          </div>
          <div class="one-right">
            <p>累计数据(GB)</p>
            <span>1024</span>
          </div>
        </div>
      </div>
      <!-- <bar></bar> -->
    </div>
    <!-- 设备状态管理 -->
    <div class="status panel1">
      <div class="public">设备状态管理</div>
      <status></status>

      <!-- <emergency></emergency> -->
    </div>
    <!-- 采集数据趋势图 -->
    <div class="collect panel1">
      <div class="public">采集数据趋势图</div>
      <div class="collect-big">
        <div class="collect-top">
          <collect :title="title5" :color="color1"></collect>
        </div>
        <div class="collect-middle">
          <collect :title="title6" :color="color2"></collect>
        </div>
        <div class="collect-bott">
          <collect :title="title7" :color="color3"></collect>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import water from "@/components/charts/water";
import status from "@/components/charts/status";
import collect from "@/components/charts/collect";
import Map from "@/components/charts/Map";
import Bar from "@/components/charts/Bar";
import fourone from "../components/charts/fourone.vue";
import pm from "../components/charts/pm.vue";

export default {
  name: "Nhgl",
  components: {
    water,
    status,
    collect,
    fourone,
    pm,
    Map,
    Bar,
  },

  data() {
    return {
      title1: "PH值推移图",
      title2: "PM值推移图",
      title3: "风速值推移图",
      title4: "土壤温度推移图",
      title5: "PM2.5/10",
      title6: "水质",
      title7: "土壤",
      title41: "空气温度推移图",
      color1: "#48EAFF",
      color2: "#457EFF",
      color3: "#48FF59",
      isFullScreen: false,
      activeClass: 4,
      itemList: [
        { name: "园区综合态势", link: "/home" },
        { name: "综合安防", link: "/Zhaf" },
        { name: "资产管理", link: "/Zcgl" },
        { name: "能耗管理", link: "/Nhgl" },
        { name: "环境监测", link: "/Hjjc" },
      ],
    };
  },
  methods: {
    getItem(index) {
      this.activeClass = index;
    },
    // toggleFullscreen() {
    //   if (this.isFullScreen) {
    //     this.exitFullScreen()
    //   } else {
    //     this.launchFullScreen(document.documentElement)
    //   }
    //   this.isFullScreen = !this.isFullScreen
    // },
    launchFullScreen(element) {
      if (element.requestFullscreen) {
        element.requestFullscreen();
      } else if (element.mozRequestFullScreen) {
        element.mozRequestFullScreen();
      } else if (element.webkitRequestFullscreen) {
        element.webkitRequestFullscreen();
      } else if (element.msRequestFullscreen) {
        element.msRequestFullscreen();
      }
    },
    exitFullScreen() {
      if (document.exitFullscreen) {
        document.exitFullScreen();
      } else if (document.webkitExitFullscreen) {
        document.webkitExitFullscreen();
      } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
      } else if (document.msExitFullscreen) {
        document.msExitFullscreen();
      }
    },
  },
};
</script>
